home *** CD-ROM | disk | FTP | other *** search
/ Chip: Special XP & Vista / Chip Spesial XP & Vista.iso / 3_Gadgets / UEFA_Informer_Gadget / UEFAinfo.gadget / scripts / func.js next >
Text (UTF-16)  |  2008-03-28  |  3KB  |  67 lines

  1. function alert(msg)
  2. {
  3.     System.Debug.outputString(msg);
  4. }
  5.  
  6. function getHTTPObject()
  7.     if (typeof XMLHttpRequest != 'undefined') { 
  8.         return new XMLHttpRequest(); 
  9.     } else if (window.ActiveXObject) {
  10.         return new ActiveXObject("Microsoft.XMLHTTP"); 
  11.     } else {
  12.         return new ActiveXObject("Msxml2.XMLHTTP"); 
  13.     }    
  14. }
  15.  
  16. function getCData(xmlNode) 
  17. {
  18.     var cdata = "";
  19.     for (var i = 0; i < xmlNode.childNodes.length; i++) 
  20.     {
  21.         if (xmlNode.childNodes[i].nodeType == 4) 
  22.         {
  23.             cdata = xmlNode.childNodes[i].nodeValue;
  24.             break;
  25.         }
  26.     }
  27.     return cdata;
  28. }
  29.  
  30. /**
  31.  * Returns the node value of a child node.
  32.  */
  33. function getChildNodeValue(xmlNode, nodeName)
  34. {
  35.     for (var i = 0; i < xmlNode.childNodes.length; i++)
  36.     {
  37.         if (xmlNode.childNodes[i].nodeName == nodeName)
  38.         {
  39.             return xmlNode.childNodes[i].firstChild.nodeValue;
  40.         }
  41.     }
  42.     return false;
  43. }
  44.  
  45. /**
  46.  * Returns the attribute value from an xml node.
  47.  */
  48. function getAttributeValue(xmlNode, attrName)
  49. {
  50.     for (var i = 0; i < xmlNode.attributes.length; i++)
  51.     {
  52.         if (xmlNode.attributes[i].name == attrName)
  53.         {
  54.             return xmlNode.attributes[i].value;
  55.         }
  56.     }
  57.     return false;
  58. }
  59.  
  60.  
  61. function update_Image(id, image, state) 
  62. {    
  63.     var objImage = document.getElementById(id);
  64.     objImage.src = "images/" + image + "_" + state + ".png";
  65. }
  66.